<template>
  <a-modal :open="open" width="680px" title="扫码移除" centered :ok-button-props="{ disabled: !isCompleted }" ok-text="确定" @ok="onOk" @cancel="onCancel">
    <div>
      <a-input class="w-full mb-2" placeholder="请扫码" maxlength="20" />
      <BaseTable :data-source="dataSource" column-code="000756" max-fill :loading="loading" row-key="lsh">
        <template #bodyCell="{ column }">
          <template v-if="column.dataIndex === 'action'">
            <a-button>删除</a-button>
          </template>
        </template>
      </BaseTable>
    </div>
  </a-modal>
</template>
<script setup>
import { ref } from 'vue'
import { message } from 'ant-design-vue'
import { useRouter } from 'vue-router'
import { post } from '@/utils/request'

const router = useRouter()
const emit = defineEmits(['update:open', 'ok'])
const props = defineProps({
  open: {
    type: Boolean,
    default: false
  },
  rowData: {
    type: Object,
    default: () => ({})
  }
})
const dataSource = ref([])

// watchEffect(() => {
//   if (props.open) {
//     formState.value = { djlb: 0, ckfs: 0, ...props.rowData }
//   }
// })
const onCancel = () => {
  emit('update:open', false)
}
const onOk = async () => {
  const { code, data } = await post('/drugStorage/psiform/doSaveTransferFormHead', {})
  if (code === 0) {
    message.success('保存成功')
    if (!props.rowData?.ckckbh) {
      router.push({
        path: '/drug/warehouse/move-detail',
        query: {
          zydh: data.zydh
        }
      })
    }
    onCancel()
    emit('ok')
  }
}
</script>
<style lang="less" scoped></style>
